//任务列表接收方的store
var taskReceiverListStore = Ext.create('Ext.data.Store', {
    model: 'TaskList',
    pageSize: 10,
    proxy: {
        type: 'ajax',
        url: zuulUrl + '/' + taskServiceName + '/taskListByReceiver/'
            + currentUserId + '/-2',// 请求
        reader: {
            type: 'json',
            rootProperty: 'taskList',
            totalProperty: 'totalCount'
        },
        extractResponseData: function (response) {
            var data=new Object();
            if (response.responseJson != null) {
                data.taskList = response.responseJson.taskReceiverViewList;
                taskNoReadSettle(response.responseJson.noReadCount);
                Ext.each(data.taskList, function (record) {
                    record.id = record.id.tr_TASK_ID;// 将任务Id取出来
                });
                data.totalCount=response.responseJson.totalCount;
            }
            return data;
        }
    },
    sortable: true,// 开启排序
    sorters: [{
        property: "createDate",
        direction: "DESC"
    }], // 根据日期来降序
    autoLoad: true
// 创建后自动调用此存储的加载方法，不加不会去请求
});

// 任务列表发送方的store
var taskResponseListStore = Ext.create('Ext.data.Store', {
    model: 'TaskList',
    pageSize: 10,
    proxy: {
        type: 'ajax',
        url: zuulUrl + '/' + taskServiceName + '/taskListByResponsible/'
            + currentUserId + '/-2',// 请求
        reader: {
            type: 'json',
            rootProperty: 'taskList',
            totalProperty: 'totalCount'
        },
        extractResponseData: function (response) {
            var data=new Object();
            if (response.responseJson != null) {
                data.taskList = response.responseJson.taskViews;
                data.totalCount=response.responseJson.totalCount;
            }
            return data;
        }
    },
    sortable: true,// 开启排序
    sorters: [{
        property: "createDate",
        direction: "DESC"
    }], // 根据日期来降序
    autoLoad: true
// 创建后自动调用此存储的加载方法，不加不会去请求
});

// //定义定时器
// var timer={
// run : function() {
// taskReceiverListStore.reload();
// taskResponseListStore.reload();
// },
// interval : 2000// 2 second
//
// }
